<template>
  <div :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" ></div>
</template>
<script>
export default {
  name: 'SvgIcon',
  props: {
    name: {
      type: String,
      default: 'assloss'
    }
  },
  computed: {
    styleExternalIcon () {
      return {
        mask: `url(${require(`@/components/SvgIcon/svg/${this.name}.svg`)}) no-repeat 50% 50%`,
        '-webkit-mask': `url(${require(`@/components/SvgIcon/svg/${this.name}.svg`)}) no-repeat 50% 50%`
      };
    }
  }
};
</script>
<style lang="scss" scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

.svg-external-icon {
  background-color: currentColor;
  mask-size: cover !important;
  display: inline-block;
}

.is-ie .svg-icon {
  display: none;
}
</style>
